<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03_加法器</title>
</head>
<script src="../node_modules/vue/dist/vue.js"></script>
<body>
    <div id="app">
        <input type="text" v-model="first" />+<input type="text" v-model="second"/>
        <button v-on:click="add">=</button>
        <input type="text" v-model="result" />
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data:{
                first: 0,
                second: 0,
                result: 0
            },
            methods:{
                add(){
                    this.result = parseInt(this.first)+ parseInt(this.second);
                }
            }
        })
    </script>
</body>
</html>